package com.designpattern.demo.design1;

/**
 * Created by lingchen on 2019/11/25. 21:00
 * mail:lingchen52@foxmail.com
 */
public class OperationDiv extends Operation {

    public double getResult() throws Exception {
        double result = 0;
        if (getNumber_b() == 0) {
            throw new Exception("除数不能为0");
        } else {
            result = getNumber_a() / getNumber_b();
        }
        return result;
    }

}
